/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cq.bd.dwr;

import java.util.Map;

import com.cq.base.domain.Page;
import com.cq.bd.base.BaseDwr;
import com.cq.bd.domain.SStaff;
import com.cq.bd.service.StaffService;

/**
 * 员工管理
 * 
 * @author huangmy
 * @date   2009-10-7
 */
public class StaffDwr extends BaseDwr {
    private static final long serialVersionUID = 1L;
    private StaffService staffService;

    /**
     * 创建员工
     * 
     * @param staff
     */
    public void createStaff(SStaff staff) {
        this.staffService.doCreateStaff(staff);
    }
    
    /**
     * 修改员工
     * 
     * @param staff
     */
    public void updateStaff(SStaff staff) {
        if (staff.getState() == null) {
            staff.setState(1);
        }
        this.staffService.doUpdateStaff(staff);
    }
    
    /**
     * 删除员工
     * 
     * @param staffId
     */
    public void deleteStaff(Long staffId) {
        this.staffService.doDeleteStaff(staffId);
    }
    
    /**
     * 获取员工
     * 
     * @param staffId
     * @return
     */
    public SStaff getStaff(Long staffId) {
        return this.staffService.doGetStaff(staffId);
    }
    
    /**
     * 分页查找员工
     * 
     * @param filter
     * @param like
     * @param sort
     * @param pageNo
     * @param pageSize
     * @return
     */
    public Page pageStaffs(Map<String, String> filter, Map<String, String> like, Map<String, String> sort, int pageNo, int pageSize){
        return this.staffService.pageStaffs(filter, like, sort, pageNo, pageSize);
    }

    public void setStaffService(StaffService staffService) {
        this.staffService = staffService;
    }
}
